package mgorm

import (
	"context"
	"sync"
)

var mgoLogCache mongodbLogCache

type mongodbLogCache map[int64]*mongodbLogCacheItem

type mongodbLogCacheItem struct {
	Ctx   context.Context
	Cost  int64
	Query string
	State string
}

var mongoDbLk sync.Mutex

func init() {
	mgoLogCache = make(mongodbLogCache)
	mongoDbLk = sync.Mutex{}
}
func addMongoLogOnStart(requestId int64, ctx context.Context, query string) {
	mongoDbLk.Lock()
	defer mongoDbLk.Unlock()
	mgoLogCache[requestId] = &mongodbLogCacheItem{
		Ctx:   ctx,
		Query: query,
		State: "START",
	}
}
func addMongoLogOnEnd(requestId int64, timeCost float64, state string) {

}
